/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.cip.esymons.sistemas.bc;

import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import org.cip.esymons.sistemas.be.SisGaleria;

/**
 *
 * @author WILLIAM
 */
public class galeriaDelegate {

    private SisGaleriaFacadeLocal local;

    public galeriaDelegate() {

        local = lookupSisGaleriaFacadeLocal();
    }

    public void create(SisGaleria sisGaleria){

        local.create(sisGaleria);
    }

    public void edit(SisGaleria sisGaleria){

        local.edit(sisGaleria);
    }

    public void remove(SisGaleria sisGaleria){

        local.remove(sisGaleria);
    }

    public SisGaleria find(Object id){

        return local.find(id);
    }

    public List<SisGaleria> findAll(){

        return local.findAll();
    }

    private SisGaleriaFacadeLocal lookupSisGaleriaFacadeLocal() {
        try {
            Context c = new InitialContext();
            return (SisGaleriaFacadeLocal) c.lookup("java:comp/env/SisGaleriaFacade");
        } catch (NamingException ne) {
            Logger.getLogger(getClass().getName()).log(Level.SEVERE, "exception caught", ne);
            throw new RuntimeException(ne);
        }
    }

    

}
